Repository navigation
Conversation
|
Test PASSed. To trigger a build add comment - ".test\W+please" |
|
@ritch and I had a long chat about the model dependencies. We have agreed that f07446a is a band-aid, a workaround for the underlying fundamental problem. We need to come up with a better way how to resolve model dependencies, so that it's easier to write unit-tests for loopback-based code. I am closing the pull request, we can reopen it once we have solved the problem of model dependency resolution. |
|
Test Failed. To trigger a build add comment - ".test\W+please" |
A method similar to loopback.getModelByType(), but checking only the models added to the app via `app.model`.
Make `loopback.rest` self-contained, so that authentication works
out of the box.
var app = loopback();
app.enableAuth();
app.use(loopback.rest());
Note that cookie parsing middleware is not added, users have to
explicitly configure that if they want to store access tokens
in cookies.
Modify `loopback.token` to skip token lookup when the request already
contains `accessToken` property. This is in line with other
connect-based middleware like `cookieParser` or `json`.
|
Test Failed. To trigger a build add comment - ".test\W+please" |
The first commit implements
app.getModelByType, which is a twin ofloopback.geModelByType, except it considers only models added viaapp.model.The second commit amends
loopback.tokenandloopback.restmiddleware to allowloopback.restto add access token lookup to all requests when the app has authentication enabled.Once this patch is accepted, there will be two main ways of setting up a LB app:
Although
loopback.restinternally callsloopback.tokenmiddleware, it's possible to install a customloopback.tokeninstance. This works becauseloopback.tokendoes not override the token already present in the request./to @ritch @raymondfeng please review. This patch is one of the steps on the path towards a better & smaller
app.jstemplate in loopback-workspace.